﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MediaPlayer.Model
{
    public class Video
    {
        public string Titre { get; set; }
        public string Source { get; set; }
        public long Duree { get; set; }

        public Video()
        {
            
        }

        public Video(string titre, string source)
        {
            Titre = titre;
            Source = source;


            Duree = 0;
            TagLib.File file = null;

            try
            {
                file = TagLib.File.Create(source);
                Duree = file.Properties.Duration.Ticks;
            }
            catch
            {

            }


        }
    }
}
